<%@ page language="java" contentType="text/html; charset=utf-8"%>
<%@ include file="/commons/taglibs.jsp"%>
<%@ include file="/commons/commonList.jsp"%>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>${key.title }</title>
<script type="text/javascript" src="${ctx }/scripts/common.js"></script>
<script type="text/javascript" src="${ctx }/scripts/ajaxException.js"></script>
<script type="text/javascript" src="${ctx }/scripts/common/prototype.js"></script>

<script type="text/javascript">
	//显示收费管理流程页面
	function showCycleForward(){
 		var url = "${ctx}/charge_chargeVoucherPrintAction.do?method=chargeCycleForwardSmall";
		top.windowOpen(url, "chargeCycleForward", "", 340, 900);
   }
   function cycleForward(url){
   		window.location.href=url;
   }

   //进行查询
   function searchInfo (){
	 	document.getElementById("monthlyStatementSearch").submit();
   }

	//设置月结月份的选中项
   function init(){
		var periodName = '${period}';
		var leng = document.getElementById("period").options.length;
  		var period = document.getElementById("period");
  		for(var i =0 ;i<leng ;i++){
  			if (periodName == period[i].value){
  				period[i].selected = "selected";
  			}
  		}
   }

   //确认月结页面
   function confirmation(){
		//var url = "${ctx}/charge_monthlyStatementAction.do?method=initConfirmation";
		//top.windowOpen(url, "monthlyStatementConfirmationForm","",190,350);

		var url = "${ctx}/charge_monthlyStatementAction.do?method=initMonthlyStatement";
		top.windowOpen(url, "monthlyStatementFrm","月结",280,450);
   }

	//进行月结
   function ongoing(firstPayDate,lastPayDate){
	showLoading("正在进行月结...");
	url = "${ctx}/charge_monthlyStatementAction.do?method=monthlyStatement&lastPayDate="+lastPayDate+"&firstPayDate="+firstPayDate;
	new Ajax.Request(url,{
		 method:'post',
		 onSuccess:back
	})
   }
   function back(response){
   	hiddenLoading();
	ajaxSubmitException(response.responseText);
  	var json = response.responseText;
		json = eval("("+json+")");
	var type = json.type;
	if(type == "success"){
		//提示成功  刷新主页面
		var period = json.period;
		SuccessAlert("操作成功");
 	 	window.location.href="${ctx }/charge_monthlyStatementAction.do?method=initMonthlyStatementMain&period="+period;
	}else if(type=="receivableWarning")
	{
		//弹出未全部进行应收计算警告
		Alert("${key.receivableWarning}");

	}else if (type == "noticeWarning"){
		//弹出未生成通知单警告
		Alert("${key.noticeWarning}");

	}else if (type == "refreshChargeDatas"){
		//还有新建状态的走表数据
		var url = "${ctx}/charge_monthlyStatementAction.do?method=newsShargeDatasWarning";
   		top.windowOpen(url,"","",360,700);
	}else if (type=="lockedWarning"){
		//还有出盘锁定状态的数据
		Alert("${key.lockedWarning}");
	}
   }

</script>

</head>

<body style="overflow:auto;" onload="init();">
<div class="pageNav_bg">
  <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td id="pageNav_leftimg"><img src="${ctx}/images/ico_charge_yj.gif" width="46" height="47"/></td>
      <td id="navWord"><span class="page_title">${key.chargeMonthlyStatement }</span></td>
      <td class="pageNav_right">
      	<a href="#" style="CURSOR: hand;" onFocus="this.blur()" onClick="showCycleForward()"><img src="${ctx}/images/charage_buzhou.gif" border="0"></a>&nbsp;&nbsp;
	    <a href="javascript:showFull_in();"><img id="full_image"  src="${ctx}/images/ico_fullscreen.gif" border="0"/></a>
	  </td>
    </tr>
  </table>
</div>

<div class="container">

	<table width="100%" border="0" cellpadding="0" cellspacing="0">
  		<tr>
		    <td class="bg_search">

			 <table border="0" cellpadding="0" cellspacing="1">
			 <!----------------------------------------------------------------------------->
			<form id="monthlyStatementSearch" name="monthlyStatementSearch"   method="post"  action="${ctx }/charge_monthlyStatementAction.do?method=initMonthlyStatementMain" >
		      <tr>
		      	<td class="grid align_left">${key.month }：</td>
		        <td class="td_search align_left"><pms:unitedSelect style="width:110px;" id="period" name="period" value="period"  dataList="${periods}"  selectText="${key.select }" optionLabel="period" optionValue="period" ></pms:unitedSelect></td>
		        <td class="td_search"><table border="0" cellpadding="0" cellspacing="0">
		            <tr>
		              <td class="buttonOffLeft" id="btn1_11"></td>
		              <td class="buttonOffMiddle" id="btn1_12" onclick="searchInfo();" onblur="btn_change(1)" onMouseOver="btn_change_over(1)" onMouseOut="btn_change_out(1)">
		              	<img src="${ctx}/images/ico_searchico.gif" alt="" border="0" align="absmiddle" />${key.search }</td>
		              <td class="buttonOffRight" id="btn1_13"></td>
		            </tr></table>
		        </td>
		      </tr>
		     </form>
			<!-------------------------------------------------------------------------------->
		    </table>

		    </td>
  		</tr>
 		<tr>
		    <td class="bg_toolBar"><table width="100%" border="0" cellspacing="0" cellpadding="0">
		        <tr>
		          <td width="35%" align="right"><table border="0" cellpadding="0" cellspacing="0" id="ico1">
		              <tr>
		              <pms:AuthTag authName="charge_monthlyStatementAction.do?method=ongoing">
		                <td  class="toolbarico"><a href="#"  onClick="confirmation();" onFocus="this.blur()">
		                	<img src="${ctx}/images/ico_sfyj_jiezhang.gif" alt="${key.monthlyStatement }" width="16" height="16" border="0" align="absbottom"/>&nbsp;${key.monthlyStatement }</a> </td>
		              </pms:AuthTag>

		              </tr></table>
		          </td>
		        </tr></table></td>
		  </tr>
		  <tr>
		    <td valign="top">
				<div class="tab_bgline" style="">
			    <ec:ceTable items ="list" var="item"
			    	action="${ctx }/charge_monthlyStatementAction.do?method=initMonthlyStatementMain" view="pmsview" styleClass="gridData2" rowsDisplayed="15">
					<ec:ceRow styleClass="grid" onclick="return false;"  >
						<ec:ceColumn title="${key.month }" property="period.period" width="9%"></ec:ceColumn>
						<ec:ceColumn title="${key.date }" property="endTime" width="8%"  cell="date" parse="yyyy-MM-dd" sortable="true"></ec:ceColumn>
						<ec:ceColumn title="${key.userName }" property="creatorName" width="14%"></ec:ceColumn>
					</ec:ceRow>
					<ec:parameter name="period" value="${period}"></ec:parameter>
				</ec:ceTable>
				</div>
		   </td>
		</tr>
	</table>
</div>

<!----------------------右键菜单---------------------->
<div id="quick_rightmenu" style="display:none;" oncontextmenu="return false" class="quick_rightmenu" onMouseOver="MM_showHideLayers('quick_rightmenu')" onMouseOut="MM_showHideLayers('quick_rightmenu')">
  <table width="100%" border="0" cellpadding="1" cellspacing="0" class="grid_quickMenu_bg" onMouseOver="MM_showHideLayers('quick_menu','','show')" onMouseOut="MM_showHideLayers('quick_menu','','hidden')">
    <tr>
      <td>
      <table width="100%" border="0" cellpadding="2" cellspacing="0">
		<!--
		<tr>
          <td class="quickMenu_toolbarico"><a href="#"  onClick="window.showModalDialog;"onFocus="this.blur()"><img src="${ctx}/images/ico_sfyj_jiezhang.gif" alt="月结" width="16" height="16" border="0" align="absbottom"/>&nbsp;月结</a></td>
		</tr>
		 -->
		<tr>
			<td class="quickMenu_toolbarico"><a href="#"  onClick="window.showModalDialog;"onFocus="this.blur()"><img src="${ctx}/images/ico_custom-index.GIF" alt="${key.report }" width="16" height="16" border="0" align="absbottom"/>&nbsp;${key.report }</a></td>
        </tr>
      </table>
      </td>
    </tr>
  </table>
</div>

</body>
</html>
